include Makefile.inc

#Standard compile and link stuff
OBJ=WalkerGroup.o qmc.o parseArgs.o params.o Intel/kernel.o
EXE=mchamr
LIB+=Intel/libReferenceQMC.a

#OpenCL definitions
ifeq (TRUE,$(COMPILE_ARCH_OPENCL))
ifeq (OSX,$(PLATFORM))
LINKFLAGS+= -framework OpenCL -framework CoreServices
CPPFLAGS+= -DPLATFORM_OSX
else
CPPFLAGS+= -I/nfs/sw/opencl/nvidia/1.0/inc/
LINKFLAGS+= -L/nfs/fweber1/opencl/OpenCL/common/lib/Linux64 -lOpenCL
endif
CPPFLAGS+= -DUSE_OPENCL
LIB+=OpenCL/libQMCOpenCL.a OpenCL/clUtil/libclUtil.a
endif

mchamr: $(OBJ) $(LIB)
	$(CXX) -o mchamr $(OBJ) $(LIB) $(LINKFLAGS)

OpenCL/libQMCOpenCL.a: force_look
	cd OpenCL; make

Intel/libReferenceQMC.a: force_look
	cd Intel; make

clean:
	-rm *.o $(LIB) Intel/*.o
	cd OpenCL; make clean

force_look:
	true
